﻿<Window x:Class="EventViewerManager.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Event Viewers" Height="450" Width="625" WindowStartupLocation="CenterScreen" Icon="Registry.ico">
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="20"></RowDefinition>
                <RowDefinition Height="90*"></RowDefinition>
                <RowDefinition Height="25"></RowDefinition>
            </Grid.RowDefinitions>
            <Menu Grid.Row="0" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top">
                <MenuItem Header="Actions">
                    <MenuItem Header="Delete">
                        <MenuItem Header="Event Log" Command="{Binding CmdDelEventLog}"></MenuItem>
                        <MenuItem Header="Event Source" Command="{Binding CmdDelEventSource}"></MenuItem>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="_Save" Command="{Binding CmdAddEventLog}"></MenuItem>
                    <MenuItem Header="Refresh" Command="{Binding CmdRefreshEvents}"></MenuItem>
                    <Separator />
                    <MenuItem Header="Exit" Command="{Binding CmdExit}"></MenuItem>
                </MenuItem>
            </Menu>
            <Grid Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50*"></ColumnDefinition>
                    <ColumnDefinition Width="50*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                </Grid.RowDefinitions>
                <GroupBox Grid.Column="0" Grid.Row="0" Margin="5" Header="Event Logs" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <ListView HorizontalAlignment="Stretch" x:Name="lstEvents" ItemsSource="{Binding EventLogs}" SelectionChanged="LstEventLogs_SelectionChanged" SelectionMode="Single" SelectedIndex="0">
                        <ListView.View>                            
                            <GridView AllowsColumnReorder="False">
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style>
                                        <Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn DisplayMemberBinding="{Binding EventLogTitle}" Width="Auto" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </GroupBox>
                <TextBox Grid.Row="1" Grid.Column="0" Margin="5" Text="{Binding Path=TextEventLog,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
                <GroupBox Grid.Column="1" Grid.Row="0" Margin="5" Header="Event Log Sources" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <ListView HorizontalAlignment="Stretch" x:Name="lstSource" ItemsSource="{Binding EventSources}" SelectionMode="Single" SelectionChanged="LstEventSources_SelectionChanged" SelectedIndex="0">
                        <ListView.View>
                            <GridView AllowsColumnReorder="False">
                                <GridView.ColumnHeaderContainerStyle>
                                    <Style>
                                        <Setter Property="FrameworkElement.Visibility" Value="Collapsed"/>
                                    </Style>
                                </GridView.ColumnHeaderContainerStyle>
                                <GridViewColumn DisplayMemberBinding="{Binding}" Width="Auto" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </GroupBox>
                <TextBox Grid.Column="1" Grid.Row="1" Margin="5" Text="{Binding Path=TextEventSource, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
            </Grid>
            <StatusBar HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Stretch" >
                <StatusBar.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                        </Grid>
                    </ItemsPanelTemplate>
                </StatusBar.ItemsPanel>
                <StatusBarItem Grid.Column="0">
                    <TextBlock Text="{Binding Message}"></TextBlock>
                </StatusBarItem>
                <StatusBarItem Grid.Column="1" HorizontalAlignment="Right">
                    <TextBlock  Text="|"></TextBlock>
                </StatusBarItem>
                <StatusBarItem Grid.Column="2" HorizontalAlignment="Right">
                    <TextBlock  Text="{Binding ApplicationVersion}"></TextBlock>
                </StatusBarItem>
            </StatusBar>
        </Grid>
    </Grid>
</Window>
